var str = "fjskfjsl fjkdsjfkls fjklsfjlsd127.0.0.1fjksldfjafjio jfk192.168.1.101sljfs fsdjfkldsfjsklfsklffjoijfoiaf asfjs fed jfjf jf sdjfsi jfi jafis function dd ( ) { }afjsdiajf iosa function abc(){} jfisjad fjsaiofjaoissf addedfds";


function match01() {
  let str1 = /[0-9]{1,3}(\.[0-9]{1,3}){3}/gi;
  console.log(str.match(str1));

}


function match02() {
  let str2 = /function\s+[a-zA-Z]+\s*\(\s*\)\s*\{\s*\}/gi;
  console.log(str.match(str2));
}

match01();
match02();
